Skip to content

fix(autogen-ext): preserve Docker GPU requests in config - #8140

Open
YZJF (YZJF) wants to merge 1 commit into
microsoft:mainfrom
YZJF:fix/docker-device-requests-roundtrip
Open

YZJF (YZJF) wants to merge 1 commit into
microsoft:mainfrom
YZJF:fix/docker-device-requests-roundtrip

Conversation

@YZJF

Copy link
Copy Markdown

Why are these changes needed?

DockerCommandLineCodeExecutor supports Docker device_requests at runtime and passes them to containers.create, but its component configuration omitted the field. Restoring an executor from component configuration therefore silently drops GPU device requests.

This adds a JSON-compatible optional config field, serializes each Docker DeviceRequest to its API mapping, and reconstructs it when loading the component. The regression test covers the supported dump_component()/load_component() path for a GPU request.

Related issue number

N/A — there is no matching open issue or pull request. #6339 added runtime GPU support but did not serialize the existing option.

Checks

  • I've included any doc changes needed for https://microsoft.github.io/autogen/. Existing documentation for the option remains accurate; no documentation change is needed.
  • I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • I've made sure all auto checks have passed. GitHub checks are pending.

Local validation:

  • uv run --no-sync pytest packages/autogen-ext/tests/code_executors/test_docker_commandline_code_executor.py -q — 16 passed
  • uv run --no-sync ruff format --check and uv run --no-sync ruff check on both changed files
  • scoped mypy and pyright on both changed files
  • uv run --no-sync poe fmt --check and uv run --no-sync poe lint in packages/autogen-ext

Package-wide poe mypy and poe pyright were also attempted. In the focused Docker test environment they report existing failures from unrelated optional integrations that are not installed; neither reported a finding in the two changed files.

AI assistance

AI assistance was used to investigate the defect and prepare the patch and regression test. The submitted diff, production path, duplicate check, and local test results were independently reviewed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant